#!/bin/bash
# build edk2 and copy it to /opt/hygon/csv
. /opt/hygon/common.sh

os_release=$(eval get_os_release)
case $os_release in
    "anolis")
    ;;
    "centos")
        source /opt/rh/devtoolset-8/enable
    ;;
    "ubuntu")
    ;;
    esac

source edksetup.sh
make -j$(getconf _NPROCESSORS_ONLN) -C BaseTools/
build -p OvmfPkg/OvmfPkgX64.dsc -a X64 -t GCC5
build -p OvmfPkg/AmdSev/AmdSevX64.dsc -a X64 -t GCC5
cp Build/OvmfX64/DEBUG_GCC5/FV/OVMF_CODE.fd /opt/hygon/csv/
cp Build/AmdSev/DEBUG_GCC5/FV/OVMF.fd /opt/hygon/csv/

